package com.yidu.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yidu.model.SnUser;
import com.yidu.service.FinanceSalesService;

/**
 * 退货action
 * @author wuqi
 * @date 2019年1月3日
 */
@Controller
@RequestMapping("/financesales")
public class FinanceSalesAction {
	/**
	 * 退货
	 */
	@Resource
	FinanceSalesService fss;
	
	/**
	 * 退货财务审核
	 * @param csId 退货详情id
	 * @param allId 业务id,采购id
	 * @param auState 退货是否
	 * @param csComment 退货意见
	 * @param session 获取session里的值
	 * @return 审核表集合
	 */
	@RequestMapping("salesAddOrUpdate")
	@ResponseBody
	public int salesAddOrUpdate(String csId,String allId,Integer auState,String csComment,HttpSession session) {
		SnUser user = (SnUser) session.getAttribute("user");
		return fss.salesAddOrUpdate(csId,allId,auState,csComment,user);
	}
	/**
	 * 退货经理审核
	 * @param csId 退货id
	 * @param allId 分公司id
	 * @param auState 退货状态
	 * @param csComment 退货意见
	 * @param session 获取session里的值
	 * @return 退货经理审核
	 */
	@RequestMapping("salesManagerAddOrUpdate")
	@ResponseBody
	public int salesManagerAddOrUpdate(String csId,String allId,Integer auState,String csComment,HttpSession session) {
		SnUser user = (SnUser) session.getAttribute("user");
		return fss.salesManagerAddOrUpdate(csId,allId,auState,csComment,user);
	}
}
